import Movie from '@/views/Movie';
import NowPlaying from '@/components/NowPlaying';
import City from '@/components/City';
import Search from '@/components/Search';
import ComingSoon from '@/components/ComingSoon';
import Detail from '@/views/Movie/Detail';

export default {
    path: '/movie',
    component: Movie,
    // 配置子路由
    children: [
        {
            path: 'nowplaying',
            component: NowPlaying
        },
        {
            path: 'city',
            component: City
        },
        {
            path: 'comingsoon',
            component: ComingSoon
        },
        {
            path: 'search',
            component: Search
        },
        {
            path: 'detail/1/:id',
            components: {
                default: NowPlaying,
                detail: Detail
            }
        },
        {
            path: 'detail/2/:id',
            components: {
                default: ComingSoon,
                detail: Detail
            }
        },
        {
            path: 'detail/3/:id',
            components: {
                default: Search,
                detail: Detail
            }
        },
        {
            path: '*',
            redirect: 'nowplaying'
        }
    ]
}